package Adapter;

public class AllMedia implements NewMediaPlayer{
    OldMediaPlayer oldMediaPlayer;
    AllMedia(String type)
    {
        if(type.equals("vlc"))
        {
           oldMediaPlayer=new VlcMedia();
        }
        else if(type.equals("mp4"))
        {
            oldMediaPlayer=new Mp4Media();
        }
    }

    @Override
    public void play(String type, String fileName) {
        if(type.equals("vlc"))
        {
            oldMediaPlayer.play(fileName);
        }
        else if(type.equals("mp4"))
        {
            oldMediaPlayer.play(fileName);
        }
    }
}
